<template>
    <view>
        <!-- weixinmao_jz/pages/agentcenter/index.wxml -->
        <!-- weixinmao_hssy/pages/user/index.wxml -->
        <view class="container">
            <view class="main" :style="'background:' + intro.maincolor"></view>

            <view class="header">
                <view v-if>
                    <view class="pic">
                        <image :src="companyinfo.thumb"></image>
                        <view class="userinfo">
                            <view>{{ companyinfo.companyname }}</view>

                            <view @tap="toEditcompany">企业信息编辑</view>
                        </view>
                    </view>
                </view>

                <view class="mymoney">
                    <view class="item_line" @tap="toNoteorder">
                        <view>{{ totaljobnum }}条</view>
                        <view>职位数量</view>
                    </view>
                    <view class="line"></view>
                    <view class="item_line" @tap="toMyorder">
                        <view>{{ totalnotenum }}次</view>
                        <view>查看简历</view>
                    </view>
                    <!--
  <view class="line">
  </view>
  <view class="item_line" bindtap="toMyorder">
      <view>{{totaltopnum}}次</view>
      <view>置顶职位</view>
  </view>
-->

                    <view class="line"></view>

                    <view class="item_line" @tap="toCompanyrole">
                        <view>购买套餐</view>
                        <view>升级会员</view>
                    </view>
                </view>
            </view>

            <view class="list">
                <view class="item" @tap="toMyjoblist">
                    <image src="/static/imgs/icon/msgorder.png"></image>
                    <view style="margin-left: 16rpx">职位管理</view>
                </view>

                <view class="item" @tap="toCompanynote">
                    <image src="/static/imgs/icon/matchorder.png"></image>
                    <view style="margin-left: 16rpx">简历管理</view>
                </view>

                <view class="item" @tap="toActive">
                    <image src="/static/imgs/icon/matchorder.png"></image>
                    <view style="margin-left: 16rpx">参与招聘会</view>
                </view>

                <view class="item" @tap="toMytasklist">
                    <image src="/static/imgs/icon/msgorder.png"></image>
                    <view style="margin-left: 16rpx">任务管理</view>
                </view>
                <!--
  <view class="item" bindtap="toMynote"><image src="../../imgs/icon/qorder.png"></image><view style="margin-left:16rpx;">查看简历数<text style='color:red;font-weight:600;'>(剩余:{{companyinfo.notenum}}条)</text></view></view>


<view class="item" bindtap="toCompanychat"><image src="../../imgs/icon/msgorder.png"></image><view style="margin-left:16rpx;">在线客服</view></view>
-->

                <view class="item" @tap="loginout">
                    <image src="/static/imgs/icon/qorder.png"></image>
                    <view style="margin-left: 16rpx">退出登录</view>
                </view>

                <!--

       <view class="item" bindtap="toShopmsg"><image src="../../resource/images/sendmsg.png"></image><view style="margin-left:16rpx;">接收消息</view></view>

        <view class="item" bindtap="loginout"><image src="../../resource/images/logout.png"></image><view style="margin-left:16rpx;">退出登录</view></view>

        -->
            </view>
        </view>

        <view class="u-tap-btn">
            <navigator url="/pages/index/index" open-type="navigate" class="u-go-home">
                <view class="iconfont fa fa-home"></view>
            </navigator>
        </view>
    </view>
</template>

<script>
import { Company } from '../../model/company-model.js';
var company = new Company();
import { Order } from '../../model/order-model.js';
var order = new Order();
import { Pay } from '../../model/pay-model.js';
var pay = new Pay();
export default {
    data() {
        return {
            companyinfo: {
                thumb: '',
                companyname: ''
            },

            totaljobnum: '',
            totalnotenum: '',
            totaltopnum: '',
            companyrole: '',

            intro: {
                maincolor: ''
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        var that = this;
        uni.setNavigationBarTitle({
            title: '企业中心'
        });
        var ctoken = uni.getStorageSync('ctoken');
        var params = {
            ctoken: ctoken
        };
        company.checkLogin(() => {
            company.companycenter((data) => {
                that.setData({
                    companyinfo: data.companyinfo,
                    totaljobnum: data.totaljobnum,
                    totalnotenum: data.totalnotenum,
                    totaltopnum: data.totaltopnum,
                    companyrole: data.companyrole
                });
            }, params);
        }, params);
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        /*
  toCompanyrole:function(){
     var that = this;
     var params = {};
     order.Roleorder((data) => {
    
        pay.execPay(data.order_id,(res) => {
   
                                  
          })
      
                                  
        },params);
   },
   */

        toEditcompany: function () {
            uni.navigateTo({
                url: '/pages/editcompany/index'
            });
        },

        toCompanychat: function () {
            uni.navigateTo({
                url: '/pages/companychat/index'
            });
        },

        loginout: function () {
            uni.clearStorageSync('companyid');
            uni.reLaunch({
                url: '/pages/companylogin/index'
            });
        },

        toCompanyrole: function () {
            uni.navigateTo({
                url: '/pages/companyrole/index'
            });
        },

        toActive: function () {
            uni.navigateTo({
                url: '/pages/active/index'
            });
        },

        toMyjoblist: function () {
            uni.navigateTo({
                url: '/pages/companyjob/index'
            });
        },

        toCompanynote: function () {
            uni.navigateTo({
                url: '/pages/companynote/index'
            });
        },

        toMytasklist: function () {
            uni.navigateTo({
                url: '/pages/tasklist/index'
            });
        },

        toNoteorder() {
            console.log('占位：函数 toNoteorder 未声明');
        },

        toMyorder() {
            console.log('占位：函数 toMyorder 未声明');
        }
    }
};
</script>
<style>
/* weixinmao_hssy/pages/user/index.wxss */
.container {
    background-color: #f5f5f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.container .main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20rpx;
    padding-bottom: 20rpx;
    height: 300rpx;
}

.container .header {
    width: 720rpx;
    height: 360rpx;
    display: flex;
    flex-direction: column;
    border-radius: 25rpx;
    background: #ffffff;
    margin-top: -40%;
}

.container .header .pic {
    width: 700rpx;
    height: 200rpx;
    align-self: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-left: 20rpx;
}
.container .header .pic image {
    width: 120rpx;
    height: 120rpx;
    border: 0rpx solid #fff;
    border-radius: 120rpx;
}
.container .header .pic .userinfo {
    height: 110rpx;
    width: 580rpx;
    font-size: 0.8rem;
    margin-left: 15rpx;
    color: #3c9bdf;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mymoney {
    width: 700rpx;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    background: #fff;
    font-size: 0.7rem;
}
.mymoney .item_line {
    width: 160rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20rpx;
    padding-bottom: 20rpx;
    color: #747474;
}

.line {
    height: 80rpx;
    border-right: 1rpx solid #e5e5e5;
    margin-top: 20rpx;
}

.mymoneyline {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    background: #fff;
    font-size: 0.7rem;
    margin-top: 20rpx;
}
.mymoneyline .item_line {
    width: 150rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20rpx;
    padding-bottom: 20rpx;
    color: #747474;
}

.mymoneyline .item_line image {
    width: 48rpx;
    height: 48rpx;
}
.container .order {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.container .order .title {
    font-size: 1rem;
    padding-top: 20rpx;
    padding-bottom: 20rpx;
    background: #fff;
    margin-top: 20rpx;
    padding-left: 20rpx;
    border-bottom: 1rpx solid #efefef;
}
.container .order .content {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    background: #fff;
    padding-bottom: 20rpx;
    padding-top: 20rpx;
}
.container .order .content .item {
    width: 250rpx;
    text-align: center;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.container .order .content .item image {
    width: 100rpx;
    height: 100rpx;
}
.container .list {
    width: 100%;
    margin-top: 20rpx;
    background: #fff;
}
.container .list .item {
    padding-top: 25rpx;
    padding-bottom: 25rpx;
    font-size: 0.9rem;
    border-bottom: 1rpx solid #efefef;
    padding-left: 20rpx;
    color: #747474;
    display: flex;
    flex-direction: row;
}
.container .list .item image {
    width: 50rpx;
    height: 50rpx;
    margin-right: 10rpx;
}
.container .list .item text {
    margin-right: 15rpx;
    color: #eb4f38;
}

.weixinmao-msg {
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.weixinmao-content {
    width: 600rpx;
    height: 450rpx;
    z-index: 4001;
    background: #fff;
    align-self: center;
    border-radius: 8rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.weixinmao-content .title {
    border-bottom: 1rpx solid #e5e5e5;
    width: 100%;
    text-align: center;
    padding-top: 20rpx;
    padding-bottom: 20rpx;
    font-size: 0.8rem;
    background: #3274e5;
    color: #fff;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.weixinmao-content .title view:nth-child(1) {
    width: 30%;
}

.weixinmao-content .title view:nth-child(2) {
    width: 40%;
}

.weixinmao-content .title view:nth-child(3) {
    width: 30%;
}

.weixinmao-content .content {
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: center;
    margin-top: 20rpx;
}
.weixinmao-content .content .item {
    font-size: 0.8rem;
    width: 100%;
    align-self: center;
    margin-bottom: 10rpx;
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.inputlist {
    border: 1rpx solid #efefef;
    width: 80%;
    height: 80rpx;
    line-height: 80rpx;
    border-radius: 4rpx;
    align-self: center;
}
.bindtel {
    width: 400rpx;
    background: #3274e5;
    color: #fff;
    height: 80rpx;
    line-height: 80rpx;
}

.weixinmao-msg-userinfo {
    position: fixed;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.weixinmao-content-userinfo {
    width: 650rpx;
    height: 100%;
    z-index: 4001;
    background: #fff;
    align-self: center;
    border-radius: 15rpx;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}
.weixinmao-content-userinfo .userinfo-title {
    align-self: center;
    font-size: 1.2rem;
    margin-top: 40rpx;
}

.weixinmao-content-userinfo .userinfo-content {
    align-self: center;
    font-size: 0.9rem;
    padding: 25rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999999;
}

.weixinmao-content-userinfo .userinfo-img {
    align-self: center;

    font-size: 0.9rem;
}

.weixinmao-content-userinfo .userinfo-img image {
    align-self: center;

    width: 400rpx;
    height: 400rpx;
}
.userinfo-button {
    display: flex;
    flex-direction: row;
    width: 400rpx;

    align-items: baseline;
    padding-bottom: 20rpx;
}
.userinfo-button button {
    background: #44b549;
    font-size: 0.8rem;
    color: #fff;
    width: 300rpx;
}

.weixinmao-content-userinfo-tel {
    width: 650rpx;
    height: 350rpx;
    z-index: 4001;
    background: #fff;
    align-self: center;
    border-radius: 15rpx;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}
.weixinmao-content-userinfo-tel .userinfo-title {
    align-self: center;
    font-size: 1.2rem;
    margin-top: 40rpx;
}

.userinfo-button-tel {
    display: flex;
    flex-direction: row;
    width: 400rpx;

    align-items: baseline;
    padding-bottom: 20rpx;
}
.userinfo-button-tel button {
    background: #44b549;
    font-size: 0.8rem;
    color: #fff;
    width: 400rpx;
    padding-top: 20rpx;
    padding-bottom: 20rpx;

    margin-top: 60rpx;
}

.weixinmao-msg-usertel {
    position: fixed;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: black;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.weixinmao-content-usertel {
    width: 550rpx;
    height: 350rpx;
    z-index: 4001;
    background: #fff;
    align-self: center;
    border-radius: 5rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.weixinmao-content-usertel .usertel-title {
    align-self: left;
    margin-left: 40rpx;
    font-size: 1.2rem;
    margin-top: 40rpx;
}

.weixinmao-content-usertel .usertel-content {
    align-self: left;
    margin-left: 40rpx;
    font-size: 0.9rem;
    margin-top: 40rpx;
}
.usertel-button {
    display: flex;
    flex-direction: row;
    width: 400rpx;
}
.usertel-button button {
    background: #fff;
    font-size: 0.8rem;
}
.usertel-button button:nth-child(2) {
    color: #d65408;
}

button::after {
    border: none;
}

.u-tap-btn {
    position: fixed;
    right: 20rpx;
    bottom: 150rpx;
}
.u-go-home {
    display: flex;
    flex-direction: row;
    justify-content: center;
    border-radius: 100%;
    width: 80rpx;
    height: 80rpx;
    border: 1px solid #eee;
    font-size: 20rpx;
    text-align: center;
    background-color: #fff;
    box-shadow: 0px 4rpx 8rpx rgba(0, 0, 0, 0.35);
    z-index: 2;
    opacity: 0.8;
    line-height: 80rpx;
    margin-bottom: 20rpx;
}
.u-go-home .iconfont {
    font-size: 1.5rem;
    color: #3274e5;
    align-self: center;
}
</style>
